package com.zmn.plat.services.impl.warranty.info;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.zmn.plat.model.entity.service.group.ServiceGroupQuery;
import com.zmn.plat.model.entity.warranty.info.WarrantyInfo;
import com.zmn.plat.model.entity.warranty.info.WarrantyInfoExport;
import com.zmn.plat.model.entity.warranty.info.WarrantyInfoQuery;
import com.zmn.plat.persistence.interfaces.warranty.info.WarrantyInfoDao;
import com.zmn.plat.services.interfaces.warranty.info.WarrantyInfoService;

@Service
public class WarrantyInfoServiceImpl implements WarrantyInfoService {

    @Resource
    WarrantyInfoDao warrantyInfoDao;

    @Override
    public WarrantyInfo findByKey(Integer warrantyInfoId) {
        return warrantyInfoDao.findByKey(warrantyInfoId);
    }

    @Override
    public WarrantyInfo findByItemIdAndCategIdAndBizType(Integer itemId, Integer categId, Integer bizType) {
        return warrantyInfoDao.findByItemIdAndCategIdAndBizType(itemId, categId, bizType);
    }

    @Override
    public List<WarrantyInfoExport> listExportExcelPageByQuery(ServiceGroupQuery query) {
        return warrantyInfoDao.listExportExcelPageByQuery(query);
    }

    @Override
    public List<WarrantyInfo> listPageByQuery(WarrantyInfoQuery query) {
        int count = countByQuery(query);
        query.setTotalCount(count);
        return warrantyInfoDao.listPageByQuery(query);
    }

    @Override
    public List<WarrantyInfo> listByQuery(WarrantyInfoQuery query) {
        return warrantyInfoDao.listByQuery(query);
    }

    @Override
    public List<WarrantyInfo> listAll() {
        return warrantyInfoDao.listAll();
    }

    @Override
    public Integer countByQuery(WarrantyInfoQuery query) {
        return warrantyInfoDao.countByQuery(query);
    }

    @Override
    public Integer updateByKey(WarrantyInfo warrantyInfo) {
        return warrantyInfoDao.updateByKey(warrantyInfo);
    }

    @Override
    public void updateBatch(List<WarrantyInfo> updateWarrantyInfos) {
        warrantyInfoDao.updateBatch(updateWarrantyInfos);
    }

    @Override
    public Integer insert(WarrantyInfo warrantyInfo) {
        return warrantyInfoDao.insert(warrantyInfo);
    }

    @Override
    public void insertBatch(List<WarrantyInfo> warrantyInfoList) {
        warrantyInfoDao.insertBatch(warrantyInfoList);
    }

    @Override
    public Integer deleteByKey(Integer warrantyInfoId) {
        return warrantyInfoDao.deleteByKey(warrantyInfoId);
    }

    @Override
    public Integer deleteByKeys(List<Integer> warrantyInfoIds) {
        return warrantyInfoDao.deleteByKeys(warrantyInfoIds);
    }

    @Override
    public void deleteByItemId(Integer itemId) {
        warrantyInfoDao.deleteByItemId(itemId);
    }

    @Override
    public void deleteByWarrantyContentIds(List<Integer> warrantyContentIds) {
        warrantyInfoDao.deleteByWarrantyContentIds(warrantyContentIds);
    }

    @Override
    public void deleteByBizTypeAndCategIdsAndItemIds(Integer keepType, List<Integer> categIdList, List<Integer> itemIdList) {
        warrantyInfoDao.deleteByBizTypeAndCategIdsAndItemIds(keepType, categIdList, itemIdList);
    }

    @Override
    public void deleteByTariffIdAndServCategIdAndCategOneId(Integer tariffId, Integer servCategId, Integer categOneId) {
        warrantyInfoDao.deleteByTariffIdAndServCategIdAndCategOneId(tariffId, servCategId, categOneId);
    }
}